package cn.edu.tju.elm.repository;

import cn.edu.tju.core.model.User;
import cn.edu.tju.elm.model.entity.Business;
import cn.edu.tju.elm.model.entity.Cart;
import cn.edu.tju.elm.model.entity.Food;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CartRepository extends JpaRepository<Cart,Long> {
    List<Cart> findAllByCustomerAndBusiness(User customer, Business business);

    Cart findAllByCustomerAndBusinessAndFood(User customer, Business business, Food food);
}
